package com.zh.common.plugins.shiro;

import org.apache.shiro.subject.Subject;
import org.apache.shiro.subject.SubjectContext;
import org.apache.shiro.web.mgt.DefaultWebSubjectFactory;

/**
 *
 * @ProjectName:
 * @Package:        com.zh.common.plugins.shiro
 * @ClassName:      StatelessDefaultSubjectFactory
 * @Description:    屏蔽session
 * @Author:         lds
 * @CreateDate:     2019/5/22 0022 20:04
 * @UpdateUser:     更新者
 * @UpdateDate:     2019/5/22 0022 20:04
 * @UpdateRemark:   更新内容
 * @Version:        1.0
 */
public class StatelessDefaultSubjectFactory extends DefaultWebSubjectFactory {

    @Override
    public Subject createSubject(SubjectContext context) {
        //不创建session
        context.setSessionCreationEnabled(false);
        return super.createSubject(context);
    }
}
